//
//  OrderSectionHeaderView.m
//  WuJieLive
//
//  Created by iMac on 2017/12/21.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "OrderSectionHeaderView.h"


@implementation OrderSectionHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithReuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self setupView];
    }
    
    return self;
}

- (void)setupView
{
    self.orderLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.orderLabel];
    [self.orderLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.centerY.equalTo(self.contentView);
    }];
    self.orderLabel.font = FontSize(14);
    self.orderLabel.textColor = TextAssistColor;
    
    self.staLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.staLabel];
    [self.staLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-15);
        make.centerY.equalTo(self.contentView);
    }];
    self.staLabel.font = FontSize(14);
    self.staLabel.textColor = MainColor;
    
    self.contentView.backgroundColor = [UIColor whiteColor];
}

- (void)bindDataWithModel:(MyOrderDetailModel *)model
{
    // 订单状态 1待付款 6待发货 11待收货 16待评论 21关闭 30完成
    NSString * string = nil;
    switch ([model.status_order integerValue]) {
        case 1:
        {
            string = @"待付款";
        }
            break;
        case 6:
        {
            string = @"待发货";
        }
            break;
        case 11:
        {
            string = @"待收货";
        }
            break;
        case 16:
        {
            string = @"待评论";
        }
            break;
        case 21:
        {
            string = @"关闭";
        }
            break;
        case 30:
        {
            string = @"完成";
        }
            break;
        default:
            break;
    }
    self.staLabel.text = string;
    self.orderLabel.text = model.order_no;
}

@end
